% File Estima_posterior_eval
% Follows after script estima_out. 
% calling posterior_eval_lmjexog
% postfunmax = @(x)lmj_postmax(x, parloadval, parposest, funcmod, Y, trainvec, prpar, prss, solveopt, addsol, ssposest); 

% [lpostd,likel,lpriord,lpriord_ss,flag_ok] = lmj_postmax(parest, parvec, ...
%     parposest, funcmod, Y, trainvec, prpar, prss, solveopt, addsol, ssposest); 

npoints = 5; 
modname = 'lmj_postmax'; 

x = parmodemat_descend(parposest, 1); 
step = 2/npoints; 


[temp_mat,Hes,ocell]=posterior_eval_lmjexog(x,step,npoints,modname, ...
    parloadval, [],parposest,funcmod,Y,trainvec, prpar, prss, solveopt, addsol, ssposest, parnames);